package com.yami.shop.bean.bo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yami.shop.bean.model.UserSearchHistory;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.*;

/**
 * @author wxf
 * @date 2023/5/18 10:18
 */
@Data
@EqualsAndHashCode
public class UserSearchHistoryVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 浏览历史表
     */
    private Long historyId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 来源 00-首页查询
     */
    private String source;

    /**
     * 动态-动态id
     */
    private String content;

    /**
     * 搜索时间
     */
    private Date createTime;

    private List<String> suggestion;


    public UserSearchHistoryVO(UserSearchHistory userSearchHistory) {
        this.historyId = userSearchHistory.getHistoryId();
        this.userId = userSearchHistory.getUserId();
        this.source = userSearchHistory.getSource();
        this.content = userSearchHistory.getContent();
        this.createTime = userSearchHistory.getCreateTime();
        this.suggestion= Arrays.asList(this.content);
    }
}
